-- GENERATED SPELL FOR [Erratic Sentry] --


function spell0_24972(pUnit, Event) --@Capacitor Overload,Self--
pUnit:FullCastSpellOnTarget(45014,pUnit)
pUnit:RegisterEvent('Sorts_24972', 610, 1)
end

function spell1_24972(pUnit, Event) --@Crystal Strike,n/a--
pUnit:FullCastSpellOnTarget(33688,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24972', 633, 1)
end

function spell2_24972(pUnit, Event) --@Electrical Overload,Self--
pUnit:FullCastSpellOnTarget(45336,pUnit)
pUnit:RegisterEvent('Sorts_24972', 1500, 1)
end

function spell3_24972(pUnit, Event) --@Stun,Self--
pUnit:FullCastSpellOnTarget(35856,pUnit)
pUnit:RegisterEvent('Sorts_24972', 3307, 1)
end

function spell4_24972(pUnit, Event) --@Suppression,Self--
pUnit:FullCastSpellOnTarget(35892,pUnit)
pUnit:RegisterEvent('Sorts_24972', 6000, 1)
end

function Sorts_24972(pUnit, Event)
local choix_sorts_24972 = math.random(0, 4)
if choix_sorts_24972 == 0 then
pUnit:RegisterEvent('spell0_24972', 1, 1)
end
if choix_sorts_24972 == 1 then
pUnit:RegisterEvent('spell1_24972', 1, 1)
end
if choix_sorts_24972 == 2 then
pUnit:RegisterEvent('spell2_24972', 1, 1)
end
if choix_sorts_24972 == 3 then
pUnit:RegisterEvent('spell3_24972', 1, 1)
end
if choix_sorts_24972 == 4 then
pUnit:RegisterEvent('spell4_24972', 1, 1)
end
end

function mob24972_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_24972', math.random(1500, 3000), 1)
end

function mob24972_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24972_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24972_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(24972, 1, 'mob24972_Action')
RegisterUnitEvent(24972, 2, 'mob24972_Leave')
RegisterUnitEvent(24972, 3, 'mob24972_Kill')
RegisterUnitEvent(24972, 4, 'mob24972_Die')
